{include file="common/header"}

<script type="text/javascript" charset="utf-8" src="__CDN__/assets/js/index/ue/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__CDN__/assets/js/index/ue/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="__CDN__/assets/js/index/ue/lang/zh-cn/zh-cn.js"></script>

	<div class="container fatieandedit">
		<p class="f">发帖</p>
		<form action="/index/bbs/addContent" method="POST" id="add-bbs-content-form">
			<div class="fatieandedit-list biaoti">
				<div class="fatie-edit-left">
					<label>标题：</label>
				</div>
				<div class="fatie-edit-right bankuai">
					<input type="text" name="title" placeholder="标题">
					<select name="model_id">
						<option>--版块选择--</option>
						{foreach name="list" item="vo"}
						<option value="{$vo.id}">{$vo.title}</option>
						{/foreach}
					</select>
				</div>
			</div>
			<div class="fatieandedit-list">
				<div class="fatie-edit-left">
					<label>内容：</label>
				</div>
				<div class="fatie-edit-right editor">
					<textarea id="editor" name="content" style="width:990px;height:500px;"></textarea>
					<div class="fatie-edit-right ">
						<input type="checkbox" checked name="ag" placeholder="切片名称" id="banquansm" form="form1">
						<p> 版权声明<label for="banquansm" class="banquansm" >这是我的原创内容，我已阅读并同意<a href="">《智识原创声明》</a></label>
						<input type="submit" id="add-bbs-content" name="" class="bangquansm-btn" value="发表"  >
					</div>
				</div>
			</div>
		</form>
		    <div style="clear: both;"></div>
            <p id="wrong" style="text-align: center;"></p>
	</div>
</div>
{include file="common/login"}
{include file="common/footer"}
<script type="text/javascript">
    var ue = UE.getEditor('editor');
</script>
<script type="text/javascript">
$('input[type=submit]').click(function() {
	var ed = (UE.getEditor('editor').getContent());
	// return false;
		var gouxuan = $('input[type=checkbox]').is(':checked');
		if(!gouxuan){
		$('#wrong').html('必须勾选同意按钮才可以发布文章')
		return false;
		}     
		if ($('input[name=title]').val() == ""){
		$('#wrong').html('文章标题不能为空');
		$('input[name=title]').focus();
		return false;
		}

		if(ed ==""){
		$('#wrong').html('文章内容不能为空');
        UE.getEditor('editor').focus();
		return false;
	}

})

</script>